package com.ruandi.bean;

public class Rectangle {
    private double chang;
    private double kuan;

    public double getChang() {
        return chang;
    }

    public void setChang(double chang) {
        this.chang = chang;
    }

    public double getKuan() {
        return kuan;
    }

    public void setKuan(double kuan) {
        this.kuan = kuan;
    }

    public Rectangle(double chang, double kuan) {
        this.chang = chang;
        this.kuan = kuan;
    }

    public Rectangle() {
    }

    public double getArea() {
        return chang * kuan;
    }

    public double getPerimeter() {
        return 2 * (chang + kuan);
    }

    public void getInfo() {
        System.out.println("长为：" + chang + " 宽为:" + kuan + " 面积为：" + getArea() + " 周长为：" + getPerimeter());
    }


//    public static void main(String[] args) {
//        Rectangle rectangle = new Rectangle(4, 2);
//        rectangle.getArea();
//        rectangle.getPerimeter();
//        rectangle.getInfo();
//    }
}
